<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>记录点击-注意事项</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="case13-demo4">
    <btn-component></btn-component>
    <btn-component></btn-component>
</div>
<script type="text/javascript">
    var case13Demo4=new Vue({
        el:"#case13-demo4",
        methods:{
            clickCount:function () {

            }
        },
        components:{
            'btn-component':{
                template:'<button v-on:click="clickCount">{{count}}</button>',
                data:function () {
                    return{
                        count:0
                    }
                },
                methods: {
                    clickCount() {
                        this.count++
                    }
                }
            }
        }
    })
</script>
</body>
</html>